//
//  MPBAuthorizationBaseTools.h
//  MiaoPai
//
//  Created by jiaxuzhou on 2017/6/21.
//  Copyright © 2017年 Jeakin. All rights reserved.
//
//


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


/**
 授权错误码
 
 - MPE_AuthorizationNotDetermined: 没有最终决定
 - MPE_AuthorizationDenied: 拒绝授权
 - MPE_AuthorizationAuthorized: 授权通过
 */
typedef NS_ENUM(NSInteger, MPE_AuthorizationStatus)
{
    MPE_AuthorizationNotDetermined = 1,
    MPE_AuthorizationDenied,
    MPE_AuthorizationAuthorized
};


typedef NS_ENUM(NSInteger, MPE_AuthorizationType)
{
    /// 获取push权限
    MPE_AuthorizationNotification = 0,
    
    /// 授权拍照
    MPE_AuthorizationCamera,
    
    /// 获取照片权限
    MPE_AuthorizationPhotos,
    
    /// 授权联系人
    MPE_AuthorizationContacts,
    
    /// 获取地理位置
    MPE_AuthorizationLocation,
    
    /// 授权日历、备忘录
    MPE_AuthorizationCalendar,
    
    /// 获取健康权限
    MPE_AuthorizationHealth,
    
    /// 获取麦克风权限
    MPE_AuthorizationMicrophone
};


typedef void (^AuthorizationHandler)(MPE_AuthorizationStatus status, NSError *__nullable error);
typedef void (^NotificationAuthorizationHandler)(NSString *__nullable deviceID,NSError *__nullable error);


@interface MPBAuthorizationBaseTools : NSObject

/**
 单独获取授权状态

 @return 授权状态
 */
- (MPE_AuthorizationStatus)authorizationStatus;

/**
 获取当前权限类别
 
 @return 注释
 */
- (MPE_AuthorizationType)permissionType;

/**
 自动授权
 */
- (void)actuallyAuthorize;


@end
